﻿using System;

namespace Fast.NormalizeActionResult
{
    /// <summary>
    /// RESTful 风格结果集
    /// </summary>
    [SkipScan]
    public class RESTfulActionResult<T>
    {
        /// <summary>
        /// 响应码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 响应消息
        /// </summary>
        public string Message { get; set; }

        /// <summary>
        /// 模型验证错误信息
        /// </summary>
        public ValidationErrorInfo[] ValidationErrors { get; set; }

        /// <summary>
        /// 是否成功
        /// </summary>
        public bool HasSuccessful { get; set; }

        /// <summary>
        /// 时间戳(毫秒)
        /// </summary>
        public long Timestamp { get; } = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();

        /// <summary>
        /// 成功返回的数据
        /// </summary>
        public T Data { get; set; }
    }
}
